package org.jaaksi.demo.animator;

import android.app.Activity;
import android.os.Bundle;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;

/**
 * Created by Fcy on 2015/10/2.
 */
public class XMLAnimation extends Activity {
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.animation_xml);

        ImageView imageView = (ImageView) findViewById(R.id.imageView);
        // 从xml中加载布局anim
        Animation animation = AnimationUtils
            .loadAnimation(this, R.anim.anim_loading);
        animation.setDuration(1000);
        imageView.startAnimation(animation);
        // 移除动画
//        imageView.clearAnimation();
    }
}